﻿@using MongoDB.Bson
@using MongoDB.Driver
@model MongoCursor<BsonDocument>
@{
    ViewBag.Title = "Index";
}
<h2>
    Users</h2>
<table cellpadding="0" cellspacing="0">
    <tr>
        <td>
            First name
        </td>
        <td>
            Last name
        </td>
        <td>
            Age
        </td>
        <td>
            Created Date
        </td>
    </tr>
    @foreach (var doc in Model)
    {
        <tr>
            <td>
                @doc["firstname"].AsString
            </td>
            <td>
                @doc["lastname"].AsString
            </td>
            <td>
                @doc["age"].ToString()
            </td>
            <td>
                @doc["createdate"].AsDateTime
            </td>
            <td>
                @Html.ActionLink("Edit user", "Edit", new { id = doc["_id"].ToString() })
            </td>
            <td>
                @Html.ActionLink("Remarks", "Index", new { controller = "Remark", id = doc["_id"].ToString() })
            </td>
        </tr>
    }
</table>
